package com.cxps.cloud.base;

import lombok.Data;

/**
 * 基本查询条件
 *
 * @author YouCai.Liu
 * @since 2021/10/8
 * ...
 */
@Data
public class BaseQuery {

    /**
     * 当前页码
     */
    private Integer current = 1;

    /**
     * 页码大小
     */
    private Integer size = 10;

    /**
     * 排序字段
     */
    private String sortBy = "";

    /**
     * 排序方式
     */
    private String sortOrder = "DESC";

    public int getCurrent() {
        if (current < -1) {
            this.current = 1;
        }
        return current;
    }

}
